﻿// See https://aka.ms/new-console-template for more information

Console.WriteLine("Hello, World!");

// 定义常量
const double tolerance = 1e-9;
// 定义 List 集合
var channelData = new List<double>{ 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1 };
// 调用 List 集合过滤
var indices = channelData.Select((value, index) => Math.Abs(value - 1.0d) < tolerance ? index : -1).Where(index => index != -1);
// IEnumerable 转 数组
var array = indices.ToArray();
// 遍历打印
foreach (var num in array)
{
    Console.Write(num + " ");
}